package small.common.core.context;

/**
 * @author jinzhou
 * @data 2023/4/13 22:16
 */
public interface Lifecycle {

    /**
     * 组件初始化
     * @throws IllegalStateException
     */
    void initialize() throws IllegalStateException;

    /**
     * 启动组件
     *
     * @return current {@link Lifecycle}
     * @throws IllegalStateException
     */
    void start() throws IllegalStateException;

    /**
     * 组件销毁
     *
     * @throws IllegalStateException
     */
    void destroy() throws IllegalStateException;
}
